# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID, tools
import logging

_logger = logging.getLogger(__name__)

class ir_attachment(osv.osv):
    _inherit = 'ir.attachment'

    def _file_read(self, cr, uid, fname, bin_size=False):
        r = ''

        try:
            r = super(ir_attachment, self)._file_read(cr, uid, fname, bin_size=bin_size)
        except OSError, IOError:
            _logger.exception("_read_file reading %s", fname)

        return r
